import 'package:car_map/page/res/gaps.dart';
import 'package:car_map/widget/load_image.dart';
import 'package:car_map/widget/my_button.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

///登录
class Login_page extends StatefulWidget {
  @override
  _loginState createState() => _loginState();
}

class _loginState extends State<Login_page> {
  TextEditingController _userController;

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    _userController = new TextEditingController();
  }

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    ScreenUtil.instance = ScreenUtil(width: 750, height: 1334)..init(context);
    return Scaffold(
      body: Container(
        child: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              ClipRect(
                child: LoadAssetImage(
                  'ic_launcher',
                  width: ScreenUtil().setWidth(150.0),
                  height: ScreenUtil().setHeight(150.0),
                ),
              ),
              Text(
                '手机查车',
                style: TextStyle(
                    color: Colors.blue,
                    fontSize: ScreenUtil().setSp(40.0),
                    fontWeight: FontWeight.bold),
              ),
              inputWidget(),
              Gaps.vGap15,
              inputWidget(),
              Gaps.vGap15,
              MyButton(title: '登录',callback: (){
                
              },),
            ],
          ),
        ),
      ),
    );
  }

  //输入框
  Widget inputWidget() {
    return Container(
      height: ScreenUtil().setHeight(70.0),
      width: ScreenUtil().setWidth(700.0),
      padding: EdgeInsets.only(left: 10.0,right: 10.0),
      decoration: BoxDecoration(
        borderRadius: BorderRadius.all(Radius.circular(20.0)),
        border: Border.all(color: Colors.black12,width: 0.5)
      ),
      child: TextField(
        controller: _userController,
        decoration: InputDecoration(
          border: InputBorder.none,
            contentPadding: EdgeInsets.only(top: 10.0,bottom: 10.0),
          icon: Icon(Icons.access_alarms)
        ),
      ),
    );
  }
}
